<template>
 <div class="box">
  <div class="font-600">
    老師已教授課堂報表
  </div>
  <div style="min-width: 1200px;" v-cloak class="mt-[30px]">
    <el-form ref="ruleFormRef" label-width="80px" :model="fromData">
      <el-form-item label="上課日期" >
        <date-controls ref="datecontrols" :searchConfig="setFormConfig" @update="update" />
      </el-form-item>
      <ExcelFooter @rebuild="rebuild" @showPage="showPage" />
    </el-form>
    <!-- <a v-show="false" ref="exportExcel" href=""></a> -->
  </div>
 </div>
</template>

<script setup>
import {ref,reactive} from 'vue'
import {SchoolList,expend} from '@/http/index.js'
import { setFormConfig } from "./sale/index.js"
import { useRouter} from "vue-router";


const ruleFormRef = ref('')
const fromData = reactive({
        time:'',
      })

const router = useRouter();
const showPage = ()=>{
        //     paymentData.value.some(item=>{
        //   if(fromData.admin_id === item.id){
        //     fromData.admin_name = item.name || item.username
        //     return true
        //   }
        // })
          let {href} = router.resolve({
          path: '/customer_report_print',
          query: {
           index:'teachReport',
           url:'admin/teacher',
           data:JSON.stringify(fromData),
          }
        })
    window.open(href,'_blank')

}
const datecontrols = ref('')
const rebuild = ()=>{
  ruleFormRef.value.resetFields()
  datecontrols.value.value = ''
  fromData.time = ''
}
const update = (e)=>{
    fromData.time = e
}
</script>

<style scoped lang='less'>
.box {
  padding: 16px 33px;
}
</style>